<?php

class ImagensView extends Imagens{
	
	public function listar($arr){
		$total = count($arr);
		for($i = 0;$i < $total;$i++){      	
			echo '<tr>';
				echo '<td width="20%"><img src="../imagens/galeria/',$arr[$i]['imagem0'],'" width="100" /></td>';
				echo '<td width="30%">',$arr[$i]['nome'],'</td>';
				echo '<td width="30%">http://',$_SERVER['SERVER_NAME'],'/imagens/galeria/',$arr[$i]['imagem0'],'</td>';
				//echo '<td width="20%" align="center" onclick="javascript:editar(',$arr[$i]['idimagens'],',\'imagens\');" class="tabelaB"><img src="images/app-edit-icon.png" width="20" align="absmiddle" /> Editar</td>';
				echo '<td width="20%" id="editar" align="center" onclick="javascript:excluir(',$arr[$i]['idimagens'],',\'Imagens\');" class="tabelaB"><img src="images/app-delete-icon.png" width="20" align="absmiddle" /> Excluir</td>';
			echo '</tr>';
	    }
	}
	public function select($arr){
		$total = count($arr);
		echo '<option value = "0">Selecione</option>';
		for($i = 0;$i < $total;$i++){
			echo '<option value="',$arr[$i]['idimagens'],'">',$arr[$i]['nome'],'</option>';
	    }
	}
	public function visualizar($arr){
		$total = count($arr);
		for($i = 0;$i < $total;$i++){
			echo '<li id="',$arr[$i]['idimagens'],'">';
				echo '<h4>',$arr[$i]['titulo'],'</h4>';
				echo '<a href="imagens.php?i=',$arr[$i]['idimagens'],'" >';
					echo '<img src="imagens/transparente.png" style="background:url(class/thumb.php?img=../imagens/fotos/',$arr[$i]['imagem0'],'&w=300&h=200) no-repeat center;" width="225" height="150" /><br />';
				echo '</a>';
				echo '<b>',$arr[$i]['legenda'],'</b><br/>';
				ImagensModel::totalImagens($arr[$i]['idimagens']);
			echo '</li>';
		}
	}
}
?>